home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue55 / Persist / EFECommon.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-02-02  |  935 b   |  43 lines

  1. unit EFECommon;
  2.  
  3. {
  4. Author     : Guy Smith-Ferrier
  5. Date       : February 2000
  6. Description:
  7. This unit is common to all of the Enhanced Fields Editors. It is contains the
  8. function which is shared by every Enhanced Fields Editor in this package,
  9. namely, EFEGetControlClass. By changing this one routine you can modify the
  10. behaviour of all of the Enhanced Field Editors.
  11.  
  12. The implemention in this module is simple. To decide which component class to
  13. use EFEGetControlClass performs a lookup of the field's class name in an INI
  14. file.
  15. }
  16.  
  17. interface
  18.  
  19. uses
  20.   DB;
  21.  
  22.   function EFEGetControlClass(Field: TField): string;
  23.  
  24. implementation
  25.  
  26. uses
  27.   INIFiles;
  28.  
  29. function EFEGetControlClass(Field: TField): string;
  30. var
  31.   INI: TINIFile;
  32. begin
  33.   Result:='';
  34.   INI:=TINIFile.Create('EFEDITOR.INI');
  35.   try
  36.     Result:=INI.ReadString('TControlClasses', Field.ClassName, '');
  37.   finally
  38.     INI.Free;
  39.   end;
  40. end;
  41.  
  42. end.
  43.